import Vue from "vue";
import VueRouter from "vue-router";
import Demo from "@/pages/demo";
import Home from "@/pages/home";
import Layout from "@/layout";

Vue.use(VueRouter);

const routes = [
    {
      path: "/",
      redirect: "home",
      component: Layout,
      children: [
        {
          path: "/home",
          name: "home",
          component: Home
        },
      ]
    },
    {
        path: "/",
        redirect: "demo",
        component: Layout,
        children: [
            {
                path: "/demo",
                name: "demo",
                component: Demo
            },
        ]
    }
];

export default new VueRouter({
    routes
});
